home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / howtos1r / frmgraph.frm next >
Text File  |  1999-08-11  |  10KB  |  301 lines

  1. VERSION 5.00
  2. Object = "{60CC5D62-2D08-11D0-BDBE-00AA00575603}#1.0#0"; "SysTray.ocx"
  3. Begin VB.Form frmGraph 
  4.    BackColor       =   &H00000000&
  5.    BorderStyle     =   1  'Fixed Single
  6.    Caption         =   "Mem Viewer Version 3"
  7.    ClientHeight    =   1950
  8.    ClientLeft      =   45
  9.    ClientTop       =   330
  10.    ClientWidth     =   4680
  11.    ControlBox      =   0   'False
  12.    Icon            =   "frmGraph.frx":0000
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   130
  16.    ScaleMode       =   3  'Pixel
  17.    ScaleWidth      =   312
  18.    ShowInTaskbar   =   0   'False
  19.    StartUpPosition =   2  'CenterScreen
  20.    Visible         =   0   'False
  21.    Begin SysTrayCtl.cSysTray SysTray 
  22.       Left            =   2280
  23.       Top             =   1560
  24.       _ExtentX        =   900
  25.       _ExtentY        =   900
  26.       InTray          =   -1  'True
  27.       TrayIcon        =   "frmGraph.frx":0442
  28.       TrayTip         =   "(GRAPH V3)"
  29.    End
  30.    Begin VB.Timer tmrUpdate 
  31.       Interval        =   1000
  32.       Left            =   2880
  33.       Top             =   1680
  34.    End
  35.    Begin VB.PictureBox Picture1 
  36.       BackColor       =   &H00000000&
  37.       Height          =   1590
  38.       Left            =   480
  39.       ScaleHeight     =   102
  40.       ScaleMode       =   3  'Pixel
  41.       ScaleWidth      =   277
  42.       TabIndex        =   3
  43.       Top             =   0
  44.       Width           =   4215
  45.       Begin VB.PictureBox picGraph 
  46.          AutoRedraw      =   -1  'True
  47.          BackColor       =   &H00000000&
  48.          BorderStyle     =   0  'None
  49.          Height          =   1500
  50.          Left            =   3960
  51.          ScaleHeight     =   100
  52.          ScaleMode       =   3  'Pixel
  53.          ScaleWidth      =   10
  54.          TabIndex        =   7
  55.          Top             =   15
  56.          Width           =   150
  57.       End
  58.    End
  59.    Begin VB.Label lblopt 
  60.       AutoSize        =   -1  'True
  61.       BackStyle       =   0  'Transparent
  62.       Caption         =   "Minimize"
  63.       ForeColor       =   &H0000FF00&
  64.       Height          =   195
  65.       Index           =   3
  66.       Left            =   1800
  67.       TabIndex        =   11
  68.       Top             =   1680
  69.       Width           =   600
  70.    End
  71.    Begin VB.Label lblCurrent 
  72.       AutoSize        =   -1  'True
  73.       BackStyle       =   0  'Transparent
  74.       Caption         =   "0%"
  75.       ForeColor       =   &H00FFFF00&
  76.       Height          =   195
  77.       Index           =   2
  78.       Left            =   0
  79.       TabIndex        =   10
  80.       ToolTipText     =   "Available Virtual"
  81.       Top             =   960
  82.       Width           =   210
  83.    End
  84.    Begin VB.Label lblCurrent 
  85.       AutoSize        =   -1  'True
  86.       BackStyle       =   0  'Transparent
  87.       Caption         =   "0%"
  88.       ForeColor       =   &H0000FF00&
  89.       Height          =   195
  90.       Index           =   1
  91.       Left            =   0
  92.       TabIndex        =   9
  93.       ToolTipText     =   "Available Physical"
  94.       Top             =   720
  95.       Width           =   210
  96.    End
  97.    Begin VB.Label lblPos 
  98.       Alignment       =   1  'Right Justify
  99.       AutoSize        =   -1  'True
  100.       BackStyle       =   0  'Transparent
  101.       Caption         =   "Curr. Pos"
  102.       ForeColor       =   &H0000FF00&
  103.       Height          =   195
  104.       Left            =   3960
  105.       TabIndex        =   8
  106.       Top             =   1680
  107.       Width           =   645
  108.    End
  109.    Begin VB.Label lblopt 
  110.       BackStyle       =   0  'Transparent
  111.       Caption         =   "Quit"
  112.       ForeColor       =   &H0000FF00&
  113.       Height          =   255
  114.       Index           =   2
  115.       Left            =   1320
  116.       TabIndex        =   6
  117.       Top             =   1680
  118.       Width           =   615
  119.    End
  120.    Begin VB.Label lblopt 
  121.       AutoSize        =   -1  'True
  122.       BackStyle       =   0  'Transparent
  123.       Caption         =   "Save"
  124.       ForeColor       =   &H0000FF00&
  125.       Height          =   195
  126.       Index           =   1
  127.       Left            =   720
  128.       TabIndex        =   5
  129.       Top             =   1680
  130.       Width           =   375
  131.    End
  132.    Begin VB.Label lblopt 
  133.       AutoSize        =   -1  'True
  134.       BackStyle       =   0  'Transparent
  135.       Caption         =   "View"
  136.       ForeColor       =   &H0000FF00&
  137.       Height          =   195
  138.       Index           =   0
  139.       Left            =   120
  140.       TabIndex        =   4
  141.       Top             =   1680
  142.       Width           =   345
  143.    End
  144.    Begin VB.Label lblCurrent 
  145.       AutoSize        =   -1  'True
  146.       BackStyle       =   0  'Transparent
  147.       Caption         =   "0%"
  148.       ForeColor       =   &H000000FF&
  149.       Height          =   195
  150.       Index           =   0
  151.       Left            =   0
  152.       TabIndex        =   2
  153.       ToolTipText     =   "Memory Load"
  154.       Top             =   480
  155.       Width           =   210
  156.    End
  157.    Begin VB.Label lblmisc 
  158.       AutoSize        =   -1  'True
  159.       BackStyle       =   0  'Transparent
  160.       Caption         =   "0%"
  161.       ForeColor       =   &H0000FF00&
  162.       Height          =   195
  163.       Index           =   1
  164.       Left            =   0
  165.       TabIndex        =   1
  166.       Top             =   1320
  167.       Width           =   210
  168.    End
  169.    Begin VB.Label lblmisc 
  170.       AutoSize        =   -1  'True
  171.       BackStyle       =   0  'Transparent
  172.       Caption         =   "100%"
  173.       ForeColor       =   &H0000FF00&
  174.       Height          =   195
  175.       Index           =   0
  176.       Left            =   0
  177.       TabIndex        =   0
  178.       Top             =   0
  179.       Width           =   390
  180.    End
  181. End
  182. Attribute VB_Name = "frmGraph"
  183. Attribute VB_GlobalNameSpace = False
  184. Attribute VB_Creatable = False
  185. Attribute VB_PredeclaredId = True
  186. Attribute VB_Exposed = False
  187. Private Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)
  188. Private Type MEMORYSTATUS
  189.     dwLength As Long
  190.     dwMemoryLoad As Long
  191.     dwTotalPhys As Long
  192.     dwAvailPhys As Long
  193.     dwTotalPageFile As Long
  194.     dwAvailPageFile As Long
  195.     dwTotalVirtual As Long
  196.     dwAvailVirtual As Long
  197. End Type
  198.  
  199. Dim lpInfoBuffer As MEMORYSTATUS
  200.  
  201. Private Sub Form_Load()
  202. LOAD App.Path + "\GRAPH.DAT" 'Load the Old Graph
  203. frmGraph.picGraph.Line (Currpos, 0)-(Currpos, 100), RGB(255, 255, 255)
  204. picGraph.Line (Currpos, 0)-(Currpos, 100), RGB(255, 255, 255)
  205. 'Currpos = 1
  206. End Sub
  207.  
  208. Private Sub Form_Resize()
  209. On Error Resume Next
  210. 'Picture1.Width = Me.ScaleWidth - lblmisc(0).Width
  211. picGraph.Left = Picture1.ScaleWidth - picGraph.Width
  212. Me.Height = 2355
  213.  
  214. End Sub
  215.  
  216.  
  217. Private Sub lblOpt_Click(Index As Integer)
  218. Select Case Index
  219.     Case 0
  220.         'VIEW
  221.         frmView.picView.Width = picGraph.Width
  222.         frmView.picView.Picture = picGraph.Image
  223.         frmView.Show
  224.     Case 1
  225.         'SAVE
  226.         SAVE App.Path + "\graph.dat" 'Save the Graph (reloaded in Form_Load)
  227.     Case 2
  228.         'QUIT
  229.         X = MsgBox("Are You Sure that you want to quit?", vbYesNo, "Quit")
  230.         If X = 6 Then
  231.             p = MsgBox("Do You want to Save the Graph?", vbYesNo, "Save")
  232.             If p = 6 Then
  233.                 SAVE App.Path + "\graph.dat" 'Save the Graph (reloaded in Form_Load)
  234.             End If
  235.             Unload Me
  236.             End
  237.         End If
  238.                 lblopt(2).ForeColor = RGB(0, 255, 0)
  239.     Case 3
  240.         'MINIMIZE
  241.         Me.Visible = False      'Unloading or minimizing does not work
  242.         SysTray.InTray = True
  243. End Select
  244. End Sub
  245.  
  246.  
  247. Private Sub lblOpt_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  248. Select Case Index
  249.     Case 0
  250.         lblopt(0).ForeColor = RGB(255, 0, 0)
  251.     Case 1
  252.         lblopt(1).ForeColor = RGB(255, 0, 0)
  253.     Case 2
  254.         lblopt(2).ForeColor = RGB(255, 0, 0)
  255. End Select
  256. End Sub
  257.  
  258.  
  259. Private Sub lblOpt_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  260. If Index = 1 Then
  261. lblopt(0).ForeColor = RGB(0, 255, 0)
  262. End If
  263. End Sub
  264.  
  265.  
  266. Private Sub SysTray_MouseDblClick(Button As Integer, Id As Lo